<div ms-controller="goods">
    <!--<div class="go-title-info">-->
                    <!--<span>-->
                        <!--<span style="color: #66a8bc;cursor: pointer" ms-click="toList">商品管理</span>-->
                        <!--<span>&nbsp;&RightAngleBracket;商品详情</span>-->
                    <!--</span>-->
        <!--<a class="pull-right" style="cursor: pointer" ms-click="infoClose">关闭</a>-->

    <!--</div>-->
    <!--商品管理详情-->

    <div style="padding:0px 20px">
        <div class="box-row hor-center">

            <div>
                <!--非编状态-->
                <div class="" ms-if="editing!=-7">
                    <h3 style="color: #66a8bc;">
                        {{info.Name}}

                        <span class="c-type c-type-0" ms-if="info.Virtual==0">实体</span>

                        <span class="c-type c-type-1" ms-if="info.Virtual==1">虚拟</span>

                        <small>
                            <span ms-if='info.ClassName!="NotClassed"'>{{info.ClassName}}</span>
                            <span ms-if='info.ClassName=="NotClassed"'>未分类</span>
                        </small>


                            <button class="btn btn-default btn-sm" ms-class="showIng:showClass" ms-click="letShowClass">
                                修改分类
                                &nbsp;
                                <b class=" icon-chevron-down "></b>
                            </button>
                            <button class="btn btn-sm btn-default pull-right" ms-click="infoEdit(info.GoodsID)">
                                编辑<i class="icon-pencil"></i>
                            </button>



                    </h3>
                    <div class="panel" style="margin-top: -12px;margin-bottom: 20px;" ms-visible="showClass">
                        <div class="box-row hor-ends">
                            选择分类：
                            <button class="btn btn-sm btn-default pull-right" ms-class="btn-primary:classEditing"
                                    ms-click="toggleEdit">
                                <i class="icon-cog"></i>
                                &nbsp;
                                <span ms-if="!classEditing">开启</span>
                                <span ms-if="classEditing">关闭</span>
                                类别管理
                            </button>
                        </div>

                        <!-- 正常向-->
                        <div ms-visible="!classEditing">

                            <!--repeat-->
                            <a class="btn btn-sm text-primary"
                               ms-repeat="classList" ms-click="changeClass(el.ClassID,el.ClassName)">
                                {{el.ClassName}}
                            </a>
                        </div>

                        <!-- 编辑态-->
                        <div ms-visible="classEditing" style="margin-bottom: 10px">
                            <div style="width: 100%;margin-bottom: 10px">
                                添加分类：
                                <input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-title" ms-duplex="newClassName"
                                       placeholder="输入分类名称"/>
                                &nbsp;
                                <button class="btn btn-primary btn-xs" ms-click="addClass">
                                    <i class="icon-plus"></i>
                                    &nbsp;添加
                                </button>

                            </div>
                            <div class="box-row warp">
                                <!--repeat-->
                                <div class="panel" style="margin-right: 10px"
                                     ms-repeat="classList">
                                    <span ms-visible="CEindex!=$index">
                                        {{el.ClassName}}
                                    </span>
                                        <input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-title" ms-duplex="editingName"
                                               ms-visible="CEindex==$index"/>
                                    <span ms-visible="CEindex!=$index">
                                        <button class="btn btn-xs  btn-success" ms-click="toEdit($index)">修改</button>
                                        <button class="btn btn-xs " ms-click="delClass($index)">删除</button>
                                    </span>
                                    <span ms-visible="CEindex==$index">
                                         <button class="btn btn-xs btn-success btn-default" ms-click="saveClass($index)">保存</button>
                                        <button class="btn btn-xs " ms-click="closeCE">取消</button>
                                    </span>
                                </div>
                            </div>

                        </div>

                    </div>
                    <div class="box-row row-same">
                        <div class="blue-block pull-left">

                        </div>
                        <div class="main-block box-row warp">
                            <!--new-->

                            <div>
                                <b>
                                    型号：
                                </b>
                                {{info.Model}}
                                <!--<span ms-if='inco.Model==""'>空</span>-->
                                &nbsp;&nbsp;&nbsp;
                            </div>
                            <div>
                                <b>
                                    商品号：
                                </b>
                                {{info.Number}}
                                <!--<span ms-if='inco.Number==""'>空</span>-->
                                &nbsp;&nbsp;&nbsp;
                            </div>
                            <div>
                                <b>
                                    规格：
                                </b>
                                {{info.Standard}}
                                <!--<span ms-if='inco.Standard==""'>空</span>-->
                                &nbsp;&nbsp;&nbsp;
                            </div>
                            <div>
                                <b>
                                    条码：
                                </b>
                                {{info.BarCode}}
                                <!--<span ms-if='inco.BarCode==""'>空</span>-->
                                &nbsp;&nbsp;&nbsp;
                            </div>
                            <div>
                                <b>
                                    单位：
                                </b>
                                {{info.Unit}}
                                <!--<span ms-if='inco.Unit==""'>空</span>-->
                                &nbsp;&nbsp;&nbsp;
                            </div>
                            <div>
                                <b>
                                    拼音码：
                                </b>
                                {{info.PinYin}}
                                <!--<span ms-if='inco.Model==""'>空</span>-->
                                &nbsp;&nbsp;&nbsp;
                            </div>
                            <div>
                                <b>
                                    库存上限：
                                </b>
                                {{info.Max}}
                                <!--<span ms-if='inco.Model==""'>空</span>-->
                                &nbsp;&nbsp;&nbsp;
                            </div>
                            <div>
                                <b>
                                    库存下限：
                                </b>
                                {{info.Min}}
                                <!--<span ms-if='inco.Model==""'>空</span>-->
                                &nbsp;&nbsp;&nbsp;
                            </div>
                            <div>
                                <b>
                                    商品备注：
                                </b>
                                {{info.Memo}}
                                <!--<span ms-if='inco.Model==""'>空</span>-->
                                &nbsp;&nbsp;&nbsp;
                            </div>
                            <!--old-->

                        </div>
                    </div>

                </div>

                <!--编辑状态-->
                <div class="" ms-if="editing==-7">
                    <h3 style="color: #66a8bc;">


                        <input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-body" style="width: 300px;height: 40px"
                               ms-duplex="info.Name"/>
                        <span class="c-type" ms-class="c-type-0:info.Virtual==0" ms-click="editInfoType(0)">实体</span>

                        <span class="c-type" ms-class="c-type-1:info.Virtual==1" ms-click="editInfoType(1)">虚拟</span>


                <span class="pull-right">
                    <a class="btn btn-sm btn-success " ms-click="infoSave"><i class=" icon-ok"></i>保存</a>
                    <a class="btn btn-sm btn-default" ms-click="editClose"><i class=" icon-remove"></i>取消</a>
                </span>
                    </h3>
                    <div>
                        <span>
                            类别：
                            <span ms-if='info.ClassName!="NotClassed"'>{{info.ClassName}}</span>
                            <span ms-if='info.ClassName=="NotClassed"'>未分类</span>
                        </span>
                        <button class="btn btn-default btn-sm" ms-class="showIng:showClass" ms-click="letShowClass">
                            修改分类
                            &nbsp;
                            <b class=" icon-chevron-down "></b>
                        </button>
                        <div class="panel" style="margin-top: -2px;" ms-visible="showClass">
                            <div class="box-row hor-ends">
                                选择分类：
                                <button class="btn btn-sm btn-default pull-right" ms-class="btn-primary:classEditing"
                                        ms-click="toggleEdit">
                                    <i class="icon-cog"></i>
                                    &nbsp;
                                    <span ms-if="!classEditing">开启</span>
                                    <span ms-if="classEditing">关闭</span>
                                    类别管理
                                </button>
                            </div>

                            <!-- 正常向-->
                            <div ms-visible="!classEditing">

                                <!--repeat-->
                                <a class="btn btn-sm text-primary"
                                   ms-repeat="classList" ms-click="changeClass(el.ClassID,el.ClassName)">
                                    {{el.ClassName}}
                                </a>
                            </div>

                            <!-- 编辑态-->
                            <div ms-visible="classEditing" style="margin-bottom: 10px">
                                <div style="width: 100%;margin-bottom: 10px">
                                    添加分类：
                                    <input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-title" ms-duplex="newClassName"
                                           placeholder="输入分类名称"/>
                                    &nbsp;
                                    <button class="btn btn-primary btn-xs" ms-click="addClass">
                                        <i class="icon-plus"></i>
                                        &nbsp;添加
                                    </button>

                                </div>
                                <div class="box-row warp">
                                    <!--repeat-->
                                    <div class="panel" style="margin-right: 10px"
                                         ms-repeat="classList">
                                    <span ms-visible="CEindex!=$index">
                                        {{el.ClassName}}
                                    </span>
                                        <input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-title" ms-duplex="editingName"
                                               ms-visible="CEindex==$index"/>
                                    <span ms-visible="CEindex!=$index">
                                        <button class="btn btn-xs  btn-success" ms-click="toEdit($index)">修改</button>
                                        <button class="btn btn-xs " ms-click="delClass($index)">删除</button>
                                    </span>
                                    <span ms-visible="CEindex==$index">
                                         <button class="btn btn-xs btn-success btn-default" ms-click="saveClass($index)">保存</button>
                                        <button class="btn btn-xs " ms-click="closeCE">取消</button>
                                    </span>
                                    </div>
                                </div>

                            </div>

                        </div>
                        <br/><br/>
                    </div>
                    <div class="box-row row-same">
                        <div class="blue-block pull-left">

                        </div>
                        <div class="main-block box-row warp">

                            <div class="">
                                型号：<input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-body" style="width: 170px"
                                          ms-duplex="info.Model"/>
                            </div>
                            <div class="">
                                商品号： <input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-body" style="width: 170px"
                                            ms-duplex="info.Number"/>
                            </div>
                            <div class="">
                                规格：<input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-body" style="width: 170px"
                                          ms-duplex="info.Standard"/>
                            </div>
                            <div class="">
                                条码：<input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-body" style="width: 170px"
                                          ms-duplex="info.BarCode"/>
                            </div>
                            <div class="">
                                单位：<input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-body" style="width: 170px" ms-duplex="info.Unit"/>
                            </div>
                            <div class="">
                                拼音码：<input type="text" maxlength="50" onkeyup="cutLength(this)" class="go-input-body" style="width: 170px"
                                           ms-duplex="info.PinYin"/>
                            </div>
                            <div class="">
                                库存上限：<input type="number" class="go-input-body" style="width: 140px"
                                           ms-duplex="info.Max"/>
                            </div>
                            <div class="">
                                库存下限：<input type="number"  class="go-input-body" style="width: 140px"
                                           ms-duplex="info.Min"/>
                            </div>
                            <div class="">
                                商品备注：<input type="text"  class="go-input-body" style="width: 290px"
                                            ms-duplex="info.Memo"/>
                            </div>

                        </div>
                    </div>

                </div>


                <div>
                    <h3 style="color: #66a8bc;">
                        价格

                    </h3>

                    <div class="blue-block pull-left" style="height: 77px;margin-right:8px ;position:absolute;">

                    </div>
                    <div style="margin-left:11px ">
                        <div class="price-block" ms-repeat="infoPrices">
                            <div ms-visible="changeing!=$index">
                                <div class="price-name">{{el.Name}}</div>
                                <div class="price-val" ms-click="changePrice($index)">￥{{el.Price}}</div>
                            </div>
                            <div ms-visible="changeing==$index">
                                <span style="  position: absolute; top: -27px;right: -2px;">
                                    <a class="btn btn-xs btn-success " ms-click="priceSave($index)"><i
                                            class=" icon-ok"></i>保存</a>
                                    <a class="btn btn-xs btn-default" ms-click="closeChange"><i
                                            class=" icon-remove"></i>取消</a>
                                 </span>

                                <div class="price-name">
                                    {{el.Name}}
                                </div>
                                <div class="price-val">
                                    <input type="number"  class="go-input-body"
                                           style="width: 125px;text-align: center;height: 25px;"
                                           ms-duplex="el.Price" placeholder="￥"/>
                                </div>
                            </div>
                        </div>

                        <!--添加价格-->
                        <!--<div class="price-block price-add">-->
                        <!--<i class="icon-plus"></i>-->
                        <!--</div>-->
                    </div>

                </div>
            </div>


            <div class="" style="padding-left: 20px">
                <h4 class="side-title">
                    本店存量：
                <span>
                    {{thisStoreTotal}}
                </span>
                </h4>

                <div class="side-block">
                    总库存：<span style="color:#0888e6">{{info.StoreTotal}}</span><br/>

                    <div ms-repeat='infoStore'>
                        {{el.StoreName}}：<span style="color: #ff0000">{{el.Amount}}</span>
                    </div>
                </div>
                <br/>
                <a class="btn btn-info btn-block" ms-click='toBill("pur")'><i class="icon-inbox"></i>入库</a>
                <a class="btn btn-info btn-block" ms-click='toBill("sell")'>销售开单</a>
                <a class="btn btn-info btn-block" ms-click='toBill("purReturn")'>采购退货</a>
                <br/>
                <div style="text-align:center;font-size:22px;color:#DDDDDD" ms-if="fromDD==0">
                    <a class="btn btn-default pull-left" ms-click="lookLastGood" ms-if="curListIndex!=0">上一个</a><span ms-if="curListIndex!=0&&curListIndex!=(list.length-1)">|</span><a class="btn btn-default pull-right" ms-click="lookNextGood" ms-if="curListIndex!=(list.length-1)">下一个</a>
                </div>
                <div style="text-align:center;font-size:22px;color:#DDDDDD" ms-if="fromDD==1">
                    <a class="btn btn-default pull-left" ms-click="lookLastDD" ms-if="DDIndex!=0">上一个</a><span ms-if="DDIndex!=0&&DDIndex!=(infoGoo.length-1)">|</span><a class="btn btn-default pull-right" ms-click="lookNextDD" ms-if="DDIndex!=(infoGoo.length-1)">下一个</a>
                </div>
                <div style="text-align:center;font-size:22px;color:#DDDDDD" ms-if="fromDD==2">
                    <a class="btn btn-default pull-left" ms-click="lookLastGCar" ms-if="GCIndex!=0">上一个</a><span ms-if="GCIndex!=0&&GCIndex!=(layout.goodsCarList.length-1)">|</span><a class="btn btn-default pull-right" ms-click="lookNextGCar" ms-if="GCIndex!=(layout.goodsCarList.length-1)">下一个</a>
                </div>
            </div>
        </div>
        <br/>
    </div>
</div>